package com.scrcu.idea.ormns.action;

import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.DialogBuilder;
import com.scrcu.idea.ormns.ui.ORMSettingsUI;

public class CodeGenerateAction extends AnAction {

    @Override
    public void actionPerformed(AnActionEvent e) {
        Project project = e.getProject();

        DialogBuilder builder = new DialogBuilder(project);
        builder.title("CGPT代码生成工具");
        builder.removeAllActions();

        // 创建并显示你的GUI Form
        ORMSettingsUI configurable;
        if (project != null) {
            configurable = new ORMSettingsUI(project, builder);
            builder.centerPanel(configurable.getMainPanel());
        }
        builder.show();

    }
}
